#!/bin/bash

cd backend
pip install -r requirements.txt

# 设置默认值
HOST="0.0.0.0"
PORT="8000"

# 解析命令行参数
while [ "$#" -gt 0 ]; do
  case "$1" in
    --host)
      HOST="$2"
      shift 2
      ;;
    --port)
      PORT="$2"
      shift 2
      ;;
    *)
      shift
      ;;
  esac
done

echo "启动后端服务器，监听 $HOST:$PORT"
python run.py --host "$HOST" --port "$PORT" 